package vip.xiaonuo.smzq.modular.kcl.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.xiaonuo.smzq.modular.kcl.entity.Clsp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import vip.xiaonuo.smzq.modular.kcl.entity.vo.KcclSpJg;

/**
 * 储量审批流程 Mapper
 *
 * @author sqq
 * @since 2024-04-23
 */
@Mapper
public interface ClspMapper extends BaseMapper<Clsp> {


    //储量审批统计
    @Select("\tWITH ytb AS ( SELECT COUNT ( * )as ytb FROM kcl_clsp where tbzt='已填报' ${sql}),\n" +
            "     wtb as ( SELECT COUNT ( * )as wtb FROM kcl_clsp where tbzt='未填报' ${sql}),\n" +
            "\t\t ysp as ( SELECT COUNT ( * )as ysp FROM kcl_clsp where  ${yspspSql}),\n" +
            "\t\t wsp as ( SELECT COUNT ( * )as wsp FROM kcl_clsp where  ${weispSql}),\n" +
            "\t\t htxg as ( SELECT COUNT ( * )as htxg FROM kcl_clsp where ${htxgSql})\n" +
            "\t\t select * from ytb,wtb,ysp,wsp,htxg;\t ")
    KcclSpJg getKcclSpJg(@Param(value = "sql")String sql,@Param(value = "weispSql")String weispSql,@Param(value = "yspspSql")String yspspSql,@Param(value = "htxgSql")String htxgSql);




}
